<html>
<head>
<meta charset="utf-8">
<script src='https://cdn.bootcss.com/echarts/3.7.0/echarts.simple.js'></script>
<script src='./js/plugins/wordcloud/echarts-wordcloud.min.js'></script>
</meta>
</head>
<body>
	<style>
html, body, #main {
	width: 100%;
	height: 100%;
	margin: 0;
}
</style>
	<div id='main'></div>

	<script th:inline="javascript">
var wordJsonString = [[${result}]];
var wordJsonArray = eval(wordJsonString);
</script>

	<script>
		var chart = echarts.init(document.getElementById('main'));

		var option = {
			tooltip : {},
			series : [ {
				type : 'wordCloud',
				gridSize : 2,
				sizeRange : [ 12, 60 ],
				rotationRange : [ -90, 90 ],
				shape : 'pentagon',
				width : 900,
				height : 600,
				drawOutOfBound : true,
				textStyle : {
					normal : {
						color : function() {
							return 'rgb('
									+ [ Math.round(Math.random() * 160),
											Math.round(Math.random() * 160),
											Math.round(Math.random() * 160) ]
											.join(',') + ')';
						}
					},
					emphasis : {
						shadowBlur : 10,
						shadowColor : '#333'
					}
				},
				data :wordJsonArray
			} ]
		};
		chart.setOption(option);
		window.onresize = chart.resize;
	</script>
</body>
</html>